***************************** Begin ADO File **************************************************************************

***** Employment decomposition by task goups

*** 1) routine worker in 1990

* 3) 
// * this variable will be recentered to year when outflows occured after collapsing the data
forvalues i = $start_year/$end_year {
	gen status_dec_etr_3_`i' 	= (emp_nat_task3d_1990 == 1 & emp_nat_task3d_`i' == . & task_3dig_2_1990 == 1 & ao_gem_imp_1990 != .) if year == 1990
	}

* 4) 
// * this variable will be recentered to year when outflows occured after collapsing the data
forvalues i = $start_year/$end_year {
	gen status_dec_etr_4_`i' 	= (emp_nat_task3d_1990 == 1 & emp_nat_task3d_`i' == 1 & task_3dig_2_1990 == 1 & task_3dig_2_`i' == 1 & ao_gem_imp_1990 != ao_gem_imp_`i' & ao_gem_imp_1990 != . & ao_gem_imp_`i' != .) if year == 1990
	}

* 5) 
gen status_dec_etr_5 = .
forvalues i = $start_year/$end_year {
	replace status_dec_etr_5 = (emp_nat_task3d_1990 == 1 & emp_nat_task3d == 1 & task_3dig_2_1990 == 1 & task_3dig_2 == 1 & ao_gem_imp_1990 != ao_gem_imp & ao_gem_imp_1990 != . & ao_gem_imp != .) if year == `i'
	}

* 6) 
gen status_dec_etr_6 = .
forvalues i = $start_year/$end_year {
	replace status_dec_etr_6 = (emp_nat_task3d_1990 == . & emp_nat_task3d == 1 & task_3dig_2 == 1 & ao_gem_imp != .) if year == `i'
	}

* 7) 
gen status_dec_etr_7 = .
forvalues i = $start_year/$end_year {
	replace status_dec_etr_7 = (emp_nat_task3d_1990 == 1 & emp_nat_task3d == 1 & task_3dig_2_1990 == 1 & task_3dig_2 == 2 & ao_gem_imp_1990 == ao_gem_imp & ao_gem_imp_1990 != . & ao_gem_imp != .) if year == `i'
	}

* 8) 
// * this variable will be recentered to year when outflows occured after collapsing the data
forvalues i = $start_year/$end_year {
	gen status_dec_etr_8_`i' 	= (emp_nat_task3d_1990 == 1 & emp_nat_task3d_`i' == 1 & task_3dig_2_1990 == 1 & task_3dig_2_`i' == 2 & ao_gem_imp_1990 != ao_gem_imp_`i' & ao_gem_imp_1990 != . & ao_gem_imp_`i' != .) if year == 1990
	}

* 9) 
gen status_dec_etr_9 = .
forvalues i = $start_year/$end_year {
	replace status_dec_etr_9 = (emp_nat_task3d_1990 == 1 & emp_nat_task3d == 1 & task_3dig_2_1990 == 2 & task_3dig_2 == 1 & ao_gem_imp_1990 == ao_gem_imp & ao_gem_imp_1990 != . & ao_gem_imp != .) if year == `i'
	}

* 10) 
gen status_dec_etr_10 = .
forvalues i = $start_year/$end_year {
	replace status_dec_etr_10 = (emp_nat_task3d_1990 == 1 & emp_nat_task3d == 1 & task_3dig_2_1990 == 2 & task_3dig_2 == 1 & ao_gem_imp_1990 != ao_gem_imp & ao_gem_imp_1990 != . & ao_gem_imp != .) if year == `i'
	}

* 11) 
gen status_dec_etr_11 = .
forvalues i = $start_year/$end_year {
	replace status_dec_etr_11 = (emp_nat_task3d_1990 == 1 & emp_nat_task3d == 1 & task_3dig_2_1990 == 1 & task_3dig_2 == 1 & ao_gem_imp_1990 == ao_gem_imp & ao_gem_imp_1990 != . & ao_gem_imp != .) if year == `i'
	}
	

*** 2) abstract worker in 1990

* 3) 
// * this variable will be recentered to year when outflows occured after collapsing the data
forvalues i = $start_year/$end_year {
	gen status_dec_eta_3_`i' 	= (emp_nat_task3d_1990 == 1 & emp_nat_task3d_`i' == . & task_3dig_2_1990 == 2 & ao_gem_imp_1990 != .) if year == 1990
	}

* 4) 
// * this variable will be recentered to year when outflows occured after collapsing the data
forvalues i = $start_year/$end_year {
	gen status_dec_eta_4_`i' 	= (emp_nat_task3d_1990 == 1 & emp_nat_task3d_`i' == 1 & task_3dig_2_1990 == 2 & task_3dig_2_`i' == 2 & ao_gem_imp_1990 != ao_gem_imp_`i' & ao_gem_imp_1990 != . & ao_gem_imp_`i' != .) if year == 1990
	}

* 5) 
gen status_dec_eta_5 = .
forvalues i = $start_year/$end_year {
	replace status_dec_eta_5 = (emp_nat_task3d_1990 == 1 & emp_nat_task3d == 1 & task_3dig_2_1990 == 2 & task_3dig_2 == 2 & ao_gem_imp_1990 != ao_gem_imp & ao_gem_imp_1990 != . & ao_gem_imp != .) if year == `i'
	}

* 6) 
gen status_dec_eta_6 = .
forvalues i = $start_year/$end_year {
	replace status_dec_eta_6 = (emp_nat_task3d_1990 == . & emp_nat_task3d == 1 & task_3dig_2 == 2 & ao_gem_imp != .) if year == `i'
	}

* 7) 
gen status_dec_eta_7 = .
forvalues i = $start_year/$end_year {
	replace status_dec_eta_7 = (emp_nat_task3d_1990 == 1 & emp_nat_task3d == 1 & task_3dig_2_1990 == 1 & task_3dig_2 == 2 & ao_gem_imp_1990 == ao_gem_imp & ao_gem_imp_1990 != . & ao_gem_imp != .) if year == `i'
	}

* 8) 
gen status_dec_eta_8 = .
forvalues i = $start_year/$end_year {
	replace status_dec_eta_8 = (emp_nat_task3d_1990 == 1 & emp_nat_task3d == 1 & task_3dig_2_1990 == 1 & task_3dig_2 == 2 & ao_gem_imp_1990 != ao_gem_imp & ao_gem_imp_1990 != . & ao_gem_imp != .) if year == `i'
	}

* 9) 
gen status_dec_eta_9 = .
forvalues i = $start_year/$end_year {
	replace status_dec_eta_9 = (emp_nat_task3d_1990 == 1 & emp_nat_task3d == 1 & task_3dig_2_1990 == 2 & task_3dig_2 == 1 & ao_gem_imp_1990 == ao_gem_imp & ao_gem_imp_1990 != . & ao_gem_imp != .) if year == `i'
	}

* 10) 
// * this variable will be recentered to year when outflows occured after collapsing the data
forvalues i = $start_year/$end_year {
	gen status_dec_eta_10_`i' 	= (emp_nat_task3d_1990 == 1 & emp_nat_task3d_`i' == 1 & task_3dig_2_1990 == 2 & task_3dig_2_`i' == 1 & ao_gem_imp_1990 != ao_gem_imp_`i' & ao_gem_imp_1990 != . & ao_gem_imp_`i' != .) if year == 1990
	}

* 11) 
gen status_dec_eta_11 = .
forvalues i = $start_year/$end_year {
	replace status_dec_eta_11 = (emp_nat_task3d_1990 == 1 & emp_nat_task3d == 1 & task_3dig_2_1990 == 2 & task_3dig_2 == 2 & ao_gem_imp_1990 == ao_gem_imp & ao_gem_imp_1990 != . & ao_gem_imp != .) if year == `i'
	}


***** Employment decomposition by age groups

*** 3) old age worker in 1990

* 3) 
// * this variable will be recentered to year when outflows occured after collapsing the data
forvalues i = $start_year/$end_year {
	gen status_dec_eao_3_`i' 	= (emp_nat_age3_1990 == 1 & emp_nat_age3_`i' == . & age_3_1990 == 3 & ao_gem_imp_1990 != .) if year == 1990
	}

* 4) 
// * this variable will be recentered to year when outflows occured after collapsing the data
forvalues i = $start_year/$end_year {
	gen status_dec_eao_4_`i' 	= (emp_nat_age3_1990 == 1 & emp_nat_age3_`i' == 1 & age_3_1990 == 3 & age_3_`i' == 3 & ao_gem_imp_1990 != ao_gem_imp_`i' & ao_gem_imp_1990 != . & ao_gem_imp_`i' != .) if year == 1990
	}

* 5) 
gen status_dec_eao_5 = .
forvalues i = $start_year/$end_year {
	replace status_dec_eao_5 = (emp_nat_age3_1990 == 1 & emp_nat_age3 == 1 & age_3_1990 == 3 & age_3 == 3 & ao_gem_imp_1990 != ao_gem_imp & ao_gem_imp_1990 != . & ao_gem_imp != .) if year == `i'
	}

* 6) 
gen status_dec_eao_6 = .
forvalues i = $start_year/$end_year {
	replace status_dec_eao_6 = (emp_nat_age3_1990 == . & emp_nat_age3 == 1 & age_3 == 3 & ao_gem_imp != .) if year == `i'
	}

* 7) 
gen status_dec_eao_7 = .
forvalues i = $start_year/$end_year {
	replace status_dec_eao_7 = (emp_nat_age3_1990 == 1 & emp_nat_age3 == 1 & age_3_1990 == 2 & age_3 == 3 & ao_gem_imp_1990 == ao_gem_imp & ao_gem_imp_1990 != . & ao_gem_imp != .) if year == `i'
	}

* 8) 
gen status_dec_eao_8 = .
forvalues i = $start_year/$end_year {
	replace status_dec_eao_8 = (emp_nat_age3_1990 == 1 & emp_nat_age3 == 1 & age_3_1990 == 2 & age_3 == 3 & ao_gem_imp_1990 != ao_gem_imp & ao_gem_imp_1990 != . & ao_gem_imp != .) if year == `i'
	}

* 9) 
gen status_dec_eao_9 = .
forvalues i = $start_year/$end_year {
	replace status_dec_eao_9 = (emp_nat_age3_1990 == 1 & emp_nat_age3 == 1 & age_3_1990 == 3 & age_3 == 3 & ao_gem_imp_1990 == ao_gem_imp & ao_gem_imp_1990 != . & ao_gem_imp != .) if year == `i'
	}

***************************** END ADO File ****************************************************************************